<?php
/**
 * @copyright meila.com
 * @author shaopu@
 * @name
 * @param
 *         $xxx = 作用
 * @static
 *         XXX = 作用
 *
 *
 */
include_once '../../__global.php';
class aj_albumList extends ml_controller{
    private $class_id;
    private $page;
    private $arrAlert = array(
        'class_id' => 'class_id',
        );

    function initParam() {
        $this->class_id = $this->input('class_id','G');            //类型
        $this->page = $this->input('page','G', 1);                    //当前页码
    }
    function checkParam(){
        $this->check_referer();
        if(empty($this->class_id)) $this->api_output(ML_RCODE_PARAM , '', $this->arrAlert['class_id']);

    }
    function main() {
        $albums = ml_tool_getdata::lbJsonData('class_'.$this->class_id, 'albumlist');
        if($albums){
            $size = 9;
            $start = ($this->page-1)*$size;
            $albums['album_list'] = array_slice($albums['album_list'],$start ,$size);
            $data['data'] = $albums;
            $this->api_output(ML_RCODE_SUCC, $data);
        }else{
            $this->api_output(ML_RCODE_BUSY);
        }

    }
}

new aj_albumList();
